package net.zoneland.knowledge.dao;

import java.util.List;
import net.zoneland.knowledge.model.QuickNav;
import net.zoneland.knowledge.model.QuickNavExample;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface QuickNavMapper {
    @SelectProvider(type=QuickNavSqlProvider.class, method="countByExample")
    long countByExample(QuickNavExample example);

    @Insert({
        "insert into AITK_QUICK_NAV (ID, CATEGORY, ",
        "NAVICODE, NAVINAME, ",
        "NAVIIMG, ORDERID, ",
        "NAVICONTENT, ITEMURL, ",
        "REMARK, CREATOR, ",
        "UPDATOR, CREATETIME, ",
        "UPDATETIME)",
        "values (#{id,jdbcType=VARCHAR}, #{category,jdbcType=VARCHAR}, ",
        "#{naviCode,jdbcType=VARCHAR}, #{naviName,jdbcType=VARCHAR}, ",
        "#{naviImg,jdbcType=VARCHAR}, #{orderId,jdbcType=DECIMAL}, ",
        "#{naviContent,jdbcType=VARCHAR}, #{itemUrl,jdbcType=VARCHAR}, ",
        "#{remark,jdbcType=VARCHAR}, #{creator,jdbcType=VARCHAR}, ",
        "#{updator,jdbcType=VARCHAR}, #{createtime,jdbcType=TIMESTAMP}, ",
        "#{updatetime,jdbcType=TIMESTAMP})"
    })
    int insert(QuickNav record);

    @InsertProvider(type=QuickNavSqlProvider.class, method="insertSelective")
    int insertSelective(QuickNav record);

    @SelectProvider(type=QuickNavSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="ID", property="id", jdbcType=JdbcType.VARCHAR),
        @Result(column="CATEGORY", property="category", jdbcType=JdbcType.VARCHAR),
        @Result(column="NAVICODE", property="naviCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="NAVINAME", property="naviName", jdbcType=JdbcType.VARCHAR),
        @Result(column="NAVIIMG", property="naviImg", jdbcType=JdbcType.VARCHAR),
        @Result(column="ORDERID", property="orderId", jdbcType=JdbcType.DECIMAL),
        @Result(column="NAVICONTENT", property="naviContent", jdbcType=JdbcType.VARCHAR),
        @Result(column="ITEMURL", property="itemUrl", jdbcType=JdbcType.VARCHAR),
        @Result(column="REMARK", property="remark", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATOR", property="creator", jdbcType=JdbcType.VARCHAR),
        @Result(column="UPDATOR", property="updator", jdbcType=JdbcType.VARCHAR),
        @Result(column="CREATETIME", property="createtime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="UPDATETIME", property="updatetime", jdbcType=JdbcType.TIMESTAMP)
    })
    List<QuickNav> selectByExample(QuickNavExample example);

    @UpdateProvider(type=QuickNavSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") QuickNav record, @Param("example") QuickNavExample example);

    @UpdateProvider(type=QuickNavSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") QuickNav record, @Param("example") QuickNavExample example);
}